package GUILayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;

import org.jfree.ui.RefineryUtilities;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;

public class TempScheme extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	

	/**
	 * Create the frame.
	 */
	public TempScheme(final ArrayList<String> temp,final ArrayList<String> pulse,final ArrayList<String> bloodPres, final ArrayList<String> resp) {
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		setVisible(true);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		
		JPanel panel_1 = new JPanel();
		panel.add(panel_1);
		panel_1.setLayout(new BoxLayout(panel_1, BoxLayout.Y_AXIS));
		
		JLabel lblNewLabel = new JLabel("Temperature scheme");
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20));
		panel_1.add(lblNewLabel);
		
		JLabel lblSelectWhichGraph = new JLabel("Select which graph to be shown");
		panel_1.add(lblSelectWhichGraph);
		
		JPanel panel_2 = new JPanel();
		panel.add(panel_2);
		panel_2.setLayout(new BoxLayout(panel_2, BoxLayout.Y_AXIS));
		
		JButton temperature = new JButton("Temperature");
		temperature.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				RefineryUtilities.centerFrameOnScreen(new TemperatureSchema("Temperature",temp));
			}
		});
		panel_2.add(temperature);
		
		JButton puls = new JButton("Puls");
		puls.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new TemperatureSchema("Puls",pulse);
			}
		});
		panel_2.add(puls);
		
		JButton bloodPressure = new JButton("Blood Pressure");
		bloodPressure.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new TemperatureSchema("Blood Pressure",bloodPres);
			}
		});
		panel_2.add(bloodPressure);
		
		JButton respiration = new JButton("Respiration");
		respiration.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new TemperatureSchema("Respiration",resp);
			}
		});
		panel_2.add(respiration);
	}

}
